home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / AMITTY.C < prev    next >
C/C++ Source or Header  |  1993-03-16  |  1KB  |  58 lines

  1. /*    SCCS Id: @(#)amitty.c     3.0    89/04/26
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4. /* tty.c - (Amiga) version */
  5.  
  6.  
  7. #define NEED_VARARGS
  8. #include "hack.h"
  9.  
  10. extern int Enable_Abort;
  11.  
  12. char erase_char, kill_char;
  13.  
  14. /*
  15.  * Get initial state of terminal, set ospeed (for termcap routines)
  16.  * and switch off tab expansion if necessary.
  17.  * Called by startup() in termcap.c and after returning from ! or ^Z
  18.  */
  19. void gettty()
  20. {
  21.     erase_char = 127;        /* DEL */
  22.     kill_char = 21;        /* cntl-U */
  23.     flags.cbreak = TRUE;
  24.     Enable_Abort = 0;
  25.     curx = 1;
  26.     cury = 1;
  27. }
  28.  
  29. /* reset terminal to original state */
  30. void settty(s)
  31. char *s;
  32. {
  33.     end_screen();
  34.     if (s) {
  35.     printf(s);
  36.     }
  37.     (void) fflush(stdout);
  38.     /* Do not close the screen, that is done in msexit() */
  39. }
  40.  
  41.  
  42. /* fatal error */
  43. /*VARARGS1*/
  44. void error VA_DECL(char *, s)
  45.     VA_START(s);
  46.     VA_INIT(s, char *);
  47.     end_screen();
  48.     putchar('\n');
  49.  
  50.         {char buf[180];
  51.     vsprintf(buf,s,VA_ARGS);
  52.         printf(buf);
  53.         }    /* Overloaded */
  54.     putchar('\n');
  55.     VA_END();
  56.     Abort(0L);
  57. }
  58.